﻿using Joz.RabbitMQClient;
using Joz.RabbitMQClient.Enum;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Joz.Producer
{
    class Program
    {
        //生产者
        static void Main(string[] args)
        {

            for (int i = 1; i < 20000; i++)
            {
                var originObject = new UpdatePurchaseOrderStatusByBillIdMqContract()
                {
                    UpdatePurchaseOrderStatusType = 1,
                    RelationBillType = 10,
                    RelationBillId = 10016779,
                    UpdateStatus = 30,
                    ModifiedBy = i,
                    Guid = Guid.NewGuid().ToString() + "++++" + i
                };

                var sendMessage =
                    EventMessageFactory.CreateEventMessageInstance(originObject, "200");
                RabbitMqClient.Instance.TriggerDirectEventMessage(sendMessage, QueueNames.LogHandle_WriteLine, true);
                Console.WriteLine(i);
            }
            Console.ReadKey();
        }
    }
}
